import { ApiProperty } from "@nestjs/swagger";
import { IsString, IsOptional, IsNumber } from "class-validator";

export class MpAuthLoginDto {
	@ApiProperty({description: '小程序登录凭证-code'})
  @IsString()
	code: string
}

export class MpAuthPhoneDto {
	@ApiProperty({description: '小程序获取手机号凭证-code'})
  @IsString()
	code: string
}

export class MpAuthUpdateUserInfoDto {
	@ApiProperty({description: '小程序用户昵称', example: null, default: null})
	@IsString()
	@IsOptional()
	nickname?: string;

	@ApiProperty({description: '小程序用户头像', example: null, default: null})
	@IsString()
	@IsOptional()
	avatar?: string;

	@ApiProperty({description: '健康积分', example: 0, default: 0})
	@IsNumber()
	@IsOptional()
	healthPoints?: number;

	@ApiProperty({description: '体质指数（Body Mass Index）', example: 22.5})
	@IsNumber()
	@IsOptional()
	bmi?: number;

	@ApiProperty({description: '收缩压（mmHg）', example: 120})
	@IsNumber()
	@IsOptional()
	bloodPressureSbp?: number;

	@ApiProperty({description: '舒张压（mmHg）', example: 80})
	@IsNumber()
	@IsOptional()
	bloodPressureDbp?: number;

	@ApiProperty({description: '空腹血糖（mmol/L）', example: 5.2})
	@IsNumber()
	@IsOptional()
	fastingBloodGlucose?: number;

	@ApiProperty({description: '低密度脂蛋白（mmol/L）', example: 3.1})
	@IsNumber()
	@IsOptional()
	ldlCholesterol?: number;

	@ApiProperty({description: '血尿酸（μmol/L）', example: 320.5})
	@IsNumber()
	@IsOptional()
	uricAcid?: number;

	@ApiProperty({description: '疾病ID', example: 1})
	@IsNumber()
	@IsOptional()
	diseaseId?: number;
}